<?php
$this->gettypes();

$bets=$this->getRows("select * from {$this->prename}bets where id in (" . $args[0] . ')');

$orderids = '';
for ($i=0; $i<count($bets); $i++)
{
    if ($i == 0)
        $orderids = $bets[$i]['wjorderId'];
    else
        $orderids .= $bets[$i]['wjorderId'];

    if($bets[$i]['isDelete']==1){
        $orderids .= ',<font color="#999999">已撤单</font>';
    }elseif(!$bets[$i]['lotteryNo']){
        $orderids .= ',<font color="#009900">未开奖</font>';
    }elseif($bets[$i]['zjCount']){
        $orderids .= ',<font color="red">已派奖</font>';
    }else{
        $orderids .= ',未中奖';
    }

    $orderids .= ',投注:' . number_format($bets[$i]['money'], 2);

    $orderids .= ',发起人:' . $bets[$i]['username'];

    $orderids .= '<br>';
}

$type = $bets[0]['type'];
$kjTime = $bets[0]['kjTime'];
$actionNo = $bets[0]['actionNo'];
$lotteryNo = $bets[0]['lotteryNo'];

?>
<div>
    <style>
        #table-modal td { height:  40px; line-height: 40px;}
        #table-modal input.text {display: block; width: 90%; height: 35px;}
        #table-modal select { width: 60%; height: 35px;display: inline-block;}
        #modal-form tr {background: #fff;}
    </style>
    <form id="modal-form" action="/admin778899.php/business/betinfoUpdateBatched" target="ajax" method="post" call="betinfoDataSubmitCode" onajax="betinfoDataBeforeSubmitCode" dataType="html">
        <input type="hidden" name="ids" value="<?=$args[0]?>"/>

        <div class="bet-info popupModal">
            <table cellpadding="0" cellspacing="0" width="100%"  id="table-modal">
                <tr>
                    <td width="120" align="right">单号(<?=count($bets)?>个)：</td>
                    <td width="480" colspan="5"><?=$orderids?></td>
                </tr>
                <tr>
                    <td align="right">玩法号码：</td>
                    <td colspan="5">
                        <?php
                        $sql="select * from {$this->prename}played where enable=1 and type=?";
                        $plays=$this->getRows($sql,$type);
                        if($plays){
                            ?>
                            <select name="playedId">
                                <?php
                                foreach($plays as $play){
                                    $playedGroup=$this->playedGroup[$play['played_groupid']];
                                    ?>
                                    <option value="<?=$play['id']?>"><?=$playedGroup['name']?>--<?=$play['name']?></option>
                                <?php } ?>
                            </select>
                        <?php } ?>
                        <input type="radio" value="1" name="is_change" id="is_changed"> <label for="is_changed" > 是否修改玩法号码</label>
                    </td>
                </tr>
                <tr>
                    <td align="right">注单金额：</td>
                    <td colspan="5"><input type="text" class="text" name="money" placeholder="不需要修改金额请留空"></td>
                </tr>
                <?php //if ($type == 50 || $type == 55) {?>
                <tr>
                    <td align="right">
                        修改车道：
                    </td>
                    <td>
                        <select name="played_groupid" >
                            <option value="">不需要修改车道则不用选择</option>
                            <?php foreach ($this->playedGroup as $key => $value) {?>
                                <?php if ($value['type'] == $type) {?>
                                    <option value="<?=$value['id']?>"><?=$value['name']?></option>
                                <?php }?>
                            <?php }?>
                        </select>
                    </td>
                </tr>
                <?php //}?>
                <tr>
                    <td align="right">开奖时间：</td>
                    <td colspan="5"><?=date('m-d H:i:s',$kjTime)?></td>
                </tr>
                <tr>
                    <td align="right">彩种：</td>
                    <td><?=$this->types[$type]['title']?></td>
                    <td align="right">期号：</td>
                    <td><?=$actionNo?></td>
                </tr>
                <tr>
                    <td align="right">开奖号：</td>
                    <td><?=$this->ifs($lotteryNo, '－')?></td>
                </tr>
                <tr>
                    <td align="right">订单状态：</td>
                    <td colspan="5"><input id="rd" name="cd"   type="radio"   value="1" checked="checked" />不作更改<input id="rd" name="cd"   type="radio"   value="2" />选中提交则撤销单据√</td>
                </tr>
            </table>
        </div>
    </form>
</div>
